
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">

  <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="{{ URL::to('/') }}">课后网</a>
  </div>

  <div id="navbar" class="navbar-collapse collapse">


    @if( Auth::check() )
      <!--登陆了-->
      <div class="nav nav-divider navbar-right" style="padding-left: 2em;padding-right: 2em; padding-top: 0.5em">

        <ul class="nav navbar-nav">
          <li class="dropdown">
             <span class="dropdown dropdown-toggle" data-toggle="dropdown" >
              <img class="img-circle" style="width: 2.2em; height: 2.2em;" src="/image/head_image/{{ $user['head_image'] }}"　 alt="头像" />
              <span class="glyphicon glyphicon-list" style="color: #f5f5f5"></span>
             </span>
             <ul id="login-state-navbar" class="dropdown-menu navbar-inverse" role="menu">

              {{--<li><a href="{{URL::to('/user/space')}}"><span class="glyphicon glyphicon-home"></span>个人空间</a></li>--}}
              <li><a href="{{URL::to('/ng#/lesson/list/all')}}"><span class="glyphicon glyphicon-pencil"></span>课程列表</a></li>
              <li><a href="{{URL::to('/ng#/personal/info/profile')}}"><span class="glyphicon glyphicon-cog"></span>个人设置</a></li>

              <li class="divider"></li>

              <li><a href="{{URL::to('authority/logout')}}"><span class="glyphicon glyphicon-log-out"></span>退出</a></li>
             </ul>
          </li>
        </ul>

      </div>
    @else
      {{Form::open(['action'=>'AuthorityController@postLogin',
        'class'=>'navbar-form navbar-right',
        'role'=>'form',
        'style'=>'margin-right: 1em'])}}
        <div class="form-group">
          <label for="login-identify" class="sr-only">用户名或邮箱</label>
          <input type="text" placeholder="用户名或邮箱" value="{{Input::old('identify')}}" name="identify" id="login-identify" required class="form-control">
        </div>

        <div class="form-group">
          <label for="login-pwd" class="sr-only">登陆密码</label>
          <input type="password" placeholder="登陆密码" value="{{Input::old('password')}}" name="password" id="login-pwd" required class="form-control">
        </div>

        <button type="submit" class="btn btn-success" style="margin-left: 1em">登陆</button>

        {{$errors->first('loginFailed', '
        <div class="alert alert-danger login-failed-alert" role="alert">
          <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
          <strong>:message</strong>
        </div>
        ')}}

      {{Form::close()}}
    @endif

  </div>

</nav>